<template>
  <div>测试组件专门用于各种测试，项目上线后删除</div>
  <!-- 全局图标组件使用方法 -->
  <svg-icon name="del" color="blue" width="300px" height="300px"></svg-icon>
  <lay-button type="primary" @click="openMsg1">
    <button>成功消息</button>
  </lay-button>
</template>

<script setup lang="ts">
import request from '@/utils/request.ts'
//引入user接口
import { reqLogin } from '@/api/user'
import { onMounted } from 'vue'
import { layer } from '@layui/layer-vue'

const openMsg1 = () => {
  layer.open({
    type: 'iframe',
    title: '远程页面',
    area: ['90%', '90%'],
    content: 'https://www.baidu.com'
  })
}

//当组件挂载完毕测试发一个请求
onMounted(() => {
  console.log('request对象', request)

  //测试登录接口
  reqLogin({ username: 'admin', password: '111111' })

  // request({
  //   url: '/user/login',
  //   method: 'post',
  //   data: {
  //     username: 'admin',
  //     password: '111111'
  //   }
  // }).then((res: any) => {
  //   console.log(res)
  // })
})
</script>

<style scoped></style>
